package vsy.buzzwordbingo.model.impl;

import java.util.ArrayList;
import java.util.List;

import vsy.buzzwordbingo.model.Game;
import vsy.buzzwordbingo.model.GameBoard;
import vsy.buzzwordbingo.model.Player;

public class GameBuilder {
	private LinkBuilder link;
	private String id;
	private String title;
	private int size;
	private String description;
	private PlayerBuilder owner;
	private PlayerBuilder winner;
	private List<String> buzzwords;
	private long creationTime;
	private long lastModificationTime;

	public Game createGame() {
		Player winner = (this.winner != null) ? this.winner.createPlayer() : null;
		Player owner = (this.owner != null) ? this.owner.createPlayer() : null;
		List<String> buzzwords = (this.buzzwords != null) ? this.buzzwords : new ArrayList<String>();  
		
		return new GameImpl(id, title, size, description, owner,
				buzzwords, winner, creationTime,
				lastModificationTime);
	}
}
